package com.zhl.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.zhl.model.Favorite;


public interface FavoriteMapper {
	
	
	@Insert("insert into `favorite` (station, station_code) values (#{station}, #{station_code})")
	int insert(Favorite favorite);

	@Select("select * from `favorite`")
	List<Favorite> findAll();
	
	@Select("select * from `favorite` where id = #{id}")
	Favorite findOne( String id);
	
	@Update("Update `favorite` set station = #{station}, station_code = #{station_code} where id = #{id}")
	int update(Favorite favorite);
	
	@Delete("delete from `favorite` where id = #{id}")
	int delete(String id);
	
}
